package com.bdcom.util;

import java.awt.Color;
import java.awt.Toolkit;
import java.text.DecimalFormat;

public class PlannerUtil {
	
	
	private static MessageResource ms=new MessageResource();
	//一英寸25.4mm
	public static double _1Inch = 25.4;
	//每英寸的像素点
	public static double DPI = Toolkit.getDefaultToolkit().getScreenResolution();
	//每毫米包含的像素点
	public static double DPMM = DPI/_1Inch;
	//每厘米包含的像素点
	public static double DPCM = DPMM*10;
	
	public static final String[] headers={getString("device name"),getString("mac address"),getString("device type")};

	public static final String[] TAB_HEADER = { getString("propertyName"),getString("value") };
	
	public static final String[] BARRIER_TAB_HEADER = { PlannerUtil.getString("texture"), PlannerUtil.getString("attenuation"),PlannerUtil.getString("color") };

	public static final String[] DEVICE_TAB_HEADER = { "Type" };

	public static final DecimalFormat format = new DecimalFormat("#0.0");
	
	public static final int SELECTED_BORDERWIDTH=4;
	
	public static final int DEFAULT_BORDERWIDTH=2;
	
	public static final int RENDER_RADIUS=16;

	public static final int DEFAULT_CANVAS_WIDTH=400;
	
	public static final int DEFAULT_CANVAS_HEIGHT=400;

	public static final Color SELECTED_BORDERCOLOR=Color.BLACK;
	
	public static final Color TEMP_POINT_COLOR=Color.GREEN;

	///events
	
	public static final String UPDATE_DEVICE_PROPERTY= "UPDATE_DEVICE_PROPERTY";
	// 添加设备
	public static final String CMD_ADD_DEV = "ADD_DEVICE";
	// 添加线性障碍物
	public static final String CMD_ADD_LINE_BARRIER = "ADD_LINE_BARRIER";
	// 添加曲线障碍物
	public static final String CMD_ADD_CURVE_BARRIER = "ADD_CURVE_BARRIER";
	// 添加矩形障碍物
	public static final String CMD_ADD_RECT_BARRIER = "ADD_RECT_BARRIER";
	// 添加圆形障碍物
	public static final String CMD_ADD_ELLIPSE_BARRIER = "ADD_ELLIPSE_BARRIER";

	public static final String CMD_DEL = "DEL";

	public static final String CMD_SELECT_BACK = "SELECT_BACK";

	public static final String CMD_RENDER_MAP = "CMD_RENDER_MAP";

	public static final String CMD_EXPORT_MAP = "CMD_EXPORT_MAP";

	public static final String CMD_RESET_CANVAS = "CMD_RESET_CANVAS";

	public static final String CMD_AUTO_LAYOUT = "CMD_AUTO_LAYOUT";

	public static final String CMD_COMBIN_POINTS = "CMD_COMBIN_POINTS";

	public static final String SET_WIDTH_HEIGHT = "SET_WIDTH_HEIGHT";

	public static final String SET_SIGN_RANGE = "SET_SIGN_RANGE";
	
	public static final String COMMAND_NEW_STR = "NEW";
	
	public static final String COMMAND_CLOSE_STR = "CLOSE";
	
	public static final String COMMAND_SAVE_FILE = "SAVE_FILE";
	
	public static final String COMMAND_DEL_FILE = "DEL_FILE";
	
	public static final String COMMAND_HELP_STR = "HELP";
	
	public static final String COMMAND_BARRIER_CONFIG = "BARRIER_CONFIG";
	
	public static final String COMMAND_DEVICETYPE_CONFIG = "DEVICETYPE_CONFIG";
	
	public static String getString(String key){
		
		return ms.getstring(key);

	}

}
